<div class="right01"><img src="content/images/04.gif" /> <a href="<?php echo site_url(); ?>/C_Main/index/">主页</a> &gt; <span>用户信息</span> &gt; <span>操作用户信息</span></div>

<?php
$attributes = array('id' => 'submitform');
echo form_open('users/C_Users_Edit/edit_User', $attributes);
?>
<table class="tables">
    <?PHP
    if (is_array($entity)) {
        foreach ($entity as $entity_item) {
            ?>
            <tr>
                <td style="width:18%">&nbsp;</td>
                <td style="width:15%">登录名：</td>
                <td style="width:17%"><input id="u_name" name="u_name" type="text" value="<?PHP echo $entity_item['u_name']; ?>"/></td>
                <td style="width:15%">用户名：</td>
                <td style="width:17%"><input id="u_password" name="u_userName" type="text" value="<?PHP echo $entity_item['u_userName']; ?>"/></td>
                <td style="width:18%">&nbsp;</td>
            </tr>
            <tr>
                <td style="width:18%">&nbsp;</td>
                <td style="width:15%">登陆密码：</td>
                <td style="width:17%"><input id="u_password" name="u_password" type="password" value="<?PHP echo $entity_item['u_password']; ?>"/></td>
                <td style="width:15%">是否是管理员：</td>
                <td style="width:17%"><input id="u_admin" name="u_admin" type="checkbox" 
                    <?PHP
                    if (strpos($entity_item["u_admin"], "1") !== FALSE)
                        echo 'checked="checked"';
                    else {
                        echo '';
                    }
                    ?>/></td>
                <td style="width:18%">&nbsp;</td>
            </tr>
            <input name="u_id" type="hidden" value="<?PHP echo $entity_item['u_id']; ?>"/>
            <?PHP
        }
    }
    ?>
</table>
<div style="margin-top: 20%; margin-left: 35%;">
    <input class="button" type="submit"  name="postsubmit" value="提交"/>
    <input class="button" type="button" name="resetbtn" onClick="resetButton()" value="返回"/>
</div>
<? echo form_close(); ?>
<script type="text/javascript">
    $("#submitform").submit(function(e){
        if ($("#u_name").val()=="" || $("#u_password").val()=="") {
            $.prompt("<span style='color:#FF0000'>请确认信息填写完整！</span>", {
                title: "提示",
                buttons: { "确定": true},
                timeout:5000
            });
            return false;
        }
    })
    //返回
    function resetButton(){
        window.location.href="<?php echo site_url(); ?>/users/C_Users_List/";
    }
    
</script>